package day7;

import java.util.Scanner;

public class Markettest {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Market a = new Market("大润发", "合工大");
        System.out.println("欢迎光临" + a.getName());
        while (true) {
            System.out.println("1.积分累计；2.积分兑换；3.查询剩余积分；4.修改密码；5.开卡；6.退出");
            System.out.println("请选择：");
            int chosen = in.nextInt();
            switch (chosen) {
                case 1: {
                    System.out.println("请输入卡号：");
                    String cardNo=in.next();
                    System.out.println("请输入消费金额：");
                    int money=in.nextInt();
                    a.addpoint(cardNo,money);
                    break;
                }
                case 2: {
                    System.out.println("请输入卡号");
                    a.change(in.next());
                    break;
                }
                case 3: {
                    System.out.println("请输入卡号：");
                    a.querypoint(in.next());
                    break;
                }
                case 4: {
                    System.out.println("请输入卡号：");
                    a.pswdchange(in.next());
                    break;
                }
                case 5: {
                    System.out.println("请输入要添加的卡号");
                    a.add(in.next());
                    break;
                }
                case 6: {
                    System.out.println("感谢使用！");
                    break;
                }
                default:{
                    System.out.println("您选择有误，请输入（1-6）之间的数字");
                }
            }
        }
    }
}
